#include "dds_com.h"
#include <stdio.h>
#include "drivers.h"

//DDS control  define
#define	DDS_DISABLE			0
#define	DDS_ENABLE			1
#define	DDS_PAUSE				2
#define	DDS_RESET				3
#define	SET_BUF_SIZE		4	//set ram buffer size
#define	WR_FULL_DAT			5	//write full data of dds ram,addr increase automatic
#define	WR_TO_RAM				6 //keep this status while writing data to RAM --- reserved
#define	SET_ADDR				7
#define	WR_ONE_BYTE			8
//#define	SET_FRE_RANGE		9
#define	SET_FRE_PARA		10
#define	SET_NONE				11	//doing nothing


typedef union PAC
{
	struct CTLDAT
	{
		unsigned char wave_select;
		unsigned long int frequence;
		//unsigned long int buffer_len;
		unsigned long int vpp;
		unsigned long int offset;
		char filename[23];
	} ctl;
	//char transfer[17];
	char transfer[36];
} PACDAT;

void pacInit(void);
int pacUpdate(void);
int pacIsChanged(void);
void updateWaveFile(char *fileName);
void updateParaToFPGA( PACDAT pacdat );
void FPGA_Init(void);

